
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.createTable('mooc_course_category', {
      id: {
        type: Sequelize.UUID,
        allowNull: false,
        primaryKey: true,
        defaultValue: Sequelize.UUIDV1,
        comment: '主键 唯一标识'
      },
      channel_id: {
        type: Sequelize.STRING(32),
        comment: '课程栏目id'
      },
      category_id: {
        type: Sequelize.STRING(32),
        comment: '课程类别id'
      },
      category_name: {
        type: Sequelize.STRING(128),
        comment: '课程类别名称'
      },
      create_time: {
        type: Sequelize.DATE,
        comment: '创建日期'
      },
      create_user: {
        type: Sequelize.UUID,
        comment: '创建用户'
      },
      last_time: {
        type: Sequelize.DATE,
        comment: '修改日期'
      },
      last_user: {
        type: Sequelize.UUID,
        comment: '修改用户'
      },
      delete_flag: {
        type: Sequelize.BOOLEAN,
        comment: '是否删除（1是，0否）',
        allowNull: false,
        defaultValue: false
      }
    })
  },

  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('mooc_course_category')
  }
}
